Class GBFilePicker

Description

Located in /GBFilePicker.module.php (line 16)

CMSModule
   |
   --GBFilePicker
Variable Summary
mixed $header
mixed $isAdmin
Method Summary
GBFilePicker GBFilePicker ()
array CleanArray (array $array)
string CleanPath (string $path, [string $fullPath = true])
string CleanURL (string $url, [string $fullUrl = true])
void ContainsIllegalChars ( $filename)
string CreateFileDropdown (string $id, string $name, [string $dir = ''], [string $selected = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = ''], [boolean $allowNone = true])
string CreateFilePickerInput (string $id, string $name, [string $value = ''], [string $dir = ''], [ $size = ''], [string $addTxt = ''], [string $type = 'image'], [string $mode = 'dropdown'], [string $showSubDirs = false], [string $upload = false], [string $delete = false], [string $createDirs = false], [string $lockInput = true], [array|string $fileExt = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [boolean $allowNone = true])
void DoAction ( $action,  $id,  $params, [ $returnid = ''])
void DoEvent ( $originator,  $eventname,  &$params)
string GetActionIcon (string $action)
void GetAdminSection ()
void GetAuthor ()
void GetAuthorEmail ()
void GetChangeLog ()
void GetContentBlockInput ( $blockName,  $value,  $params, [ $adding = false])
string GetFileIcon (array $fileInfo)
array GetFiles ([string $dir = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = 'image'], [boolean $excludeDirs = false])
string GetFileType (string $file, [string $useMime = false])
void GetFriendlyName ()
void GetHelp ()
void GetName ()
string GetThumbnail (string $path, [string $makeThumbnail = true], [string $urlOnly = false])
void GetVersion ()
void HandleFileResizing ( $source,  $output,  $newWidth,  $newHeight, [ $keepAspectRatio = true], [ $allowUpscaling = false], [ $quality = 100])
void HandlesEvents ()
void HasAdmin ()
void HasCapability ( $capability, [ $params = array()])
void IsDirEmpty ( $dir)
bool IsFalse (mixed $value)
void IsPluginModule ()
bool IsTrue (mixed $value)
boolean IsVarEmpty ( &$var, [boolean $trim = true], [boolean $unsetEmptyIndexes = false], mixed $var)
void SetParameters ()
void SortFiles ( $file1,  $file2)
Variables
mixed $displaySettings (line 18)
mixed $header (line 20)
mixed $isAdmin (line 19)
Methods
Constructor GBFilePicker (line 22)
GBFilePicker GBFilePicker ()
CleanArray (line 1046)

Not part of the module api.

Removes empty elements from an array. (can be useful when using function explode to create the array from a csv)

  • return: - an array without empty elements or an empty array
array CleanArray (array $array)
  • array $array: - the array to clean up
CleanPath (line 727)

Not part of the module api.

Replaces all multiple DIRECTORY_SEPARATOR, dots and (multiple) slashes with one single DIRECTORY_SEPARATOR to make a clean save url parameter

  • return: - the clean path
string CleanPath (string $path, [string $fullPath = true])
  • string $path: - the path to clean
  • string $fullPath: - true to prepend uploads path on return, false to return only the cleaned $path
CleanURL (line 750)

Not part of the module api.

Replaces all multiple slashes, dots and (multiple) backslashes with one single slash to make a clean save url parameter

  • return: - the clean url
string CleanURL (string $url, [string $fullUrl = true])
  • string $url: - the url to clean
  • string $fullUrl: - true to prepend uploads url on return, false to return only the cleaned $url
ContainsIllegalChars (line 993)

Not part of the module api.

Taken from TinyMCE Module.

void ContainsIllegalChars ( $filename)
  • $filename
CreateFileDropdown (line 502)

Not part of the module api.

Create a dropdown form element containing a list of files that match certain conditions

  • return: - the HTML output of a select element with options
string CreateFileDropdown (string $id, string $name, [string $dir = ''], [string $selected = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = ''], [boolean $allowNone = true])
  • string $id: - the module id
  • string $name: - the name of the input field
  • string $dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
  • string $selected: - the preselected value
  • array|string $excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
  • array|string $includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
  • array|string $excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
  • array|string $includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
  • array|string $fileExt: - filesufixes to include (array('foo','bar',...) or csv)
  • string $type: - file or image
  • boolean $allowNone: - set to false to hide the option 'none'
CreateFilePickerInput (line 315)

Not part of the module api.

Creates the filepicker input.

  • return: - the HTML output of the filepicker
string CreateFilePickerInput (string $id, string $name, [string $value = ''], [string $dir = ''], [ $size = ''], [string $addTxt = ''], [string $type = 'image'], [string $mode = 'dropdown'], [string $showSubDirs = false], [string $upload = false], [string $delete = false], [string $createDirs = false], [string $lockInput = true], [array|string $fileExt = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [boolean $allowNone = true])
  • string $id: - the module id
  • string $name: - the name of the input field
  • string $value: - the preselected value
  • string $dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
  • string $addTxt: - any additional text that will be added to the html text input when tag is rendered (only works with mode='browser' at the moment)
  • string $type: - 'image' or 'file'
  • string $mode: - 'dropdown' or 'browser'
  • string $showSubDirs: - set to true to show subdirs
  • string $upload: - set to true to allow file upload
  • string $delete: - set to true to allow to delete of files and empty subdirs
  • string $createDirs: - set to true to allow to create subdirs
  • string $lockInput: - set to false to allow to enter the path to the file
  • array|string $fileExt: - allowed file extensions (array or csv)
  • array|string $excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
  • array|string $includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
  • array|string $excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
  • array|string $includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
  • boolean $allowNone: - set to false to hide the option 'none'
  • $size
DoAction (line 113)
void DoAction ( $action,  $id,  $params, [ $returnid = ''])
  • $action
  • $id
  • $params
  • $returnid
DoEvent (line 145)
void DoEvent ( $originator,  $eventname,  &$params)
  • $originator
  • $eventname
  • &$params
GetActionIcon (line 833)

Not part of the module api.

Gets the icon for the file operation. If FileManager is installed it uses FileManager icons. Otherwise it uses own icons

  • return: - the HTML ouput of an image
string GetActionIcon (string $action)
  • string $action: - the file operation (e.g. 'delete')
GetAdminDescription (line 81)
void GetAdminDescription ()
GetAdminSection (line 77)
void GetAdminSection ()
GetAuthor (line 54)
void GetAuthor ()
GetAuthorEmail (line 58)
void GetAuthorEmail ()
GetChangeLog (line 62)
void GetChangeLog ()
GetContentBlockInput (line 169)
void GetContentBlockInput ( $blockName,  $value,  $params, [ $adding = false])
  • $blockName
  • $value
  • $params
  • $adding
GetFileIcon (line 808)

Not part of the module api.

Gets the icon for a file. If FileManager is installed it uses FileManager icons. Otherwise it uses own icons.

  • return: - the HTML ouput of an image
string GetFileIcon (array $fileInfo)
  • array $fileInfo: - an array with info about the file ('ext'=>file extension, 'isdir'=>true/false, isimage=>true/false)
GetFiles (line 555)

Not part of the module api.

Return an array containing a list of files in a directory. Performs a non recursive search.

array GetFiles ([string $dir = ''], [array|string $excludePrefix = ''], [array|string $includePrefix = ''], [array|string $excludeSufix = ''], [array|string $includeSufix = ''], [array|string $fileExt = ''], [string $type = 'image'], [boolean $excludeDirs = false])
  • string $dir: - the directory to list the files of (may be relative to uploads dir or absolute path)
  • array|string $excludePrefix: - fileprefixes to exclude (array('foo','bar',...) or csv)
  • array|string $includePrefix: - fileprefixes to include (array('foo','bar',...) or csv)
  • array|string $excludeSufix: - filesufixes to exclude (array('foo','bar',...) or csv)
  • array|string $includeSufix: - filesufixes to include (array('foo','bar',...) or csv)
  • array|string $fileExt: - filesufixes to include (array('foo','bar',...) or csv)
  • string $type: - file or image
  • boolean $excludeDirs: - set to true to exclude directories
GetFileType (line 463)

Not part of the module api.

Gets the file type of a file.

  • return: - the mime-type or file extension
string GetFileType (string $file, [string $useMime = false])
  • string $file: - the path to a file
  • string $useMime: - set to true to detect file type by mime type
GetFriendlyName (line 38)
void GetFriendlyName ()
GetHelp (line 46)
void GetHelp ()
GetName (line 34)
void GetName ()
GetThumbnail (line 774)

Not part of the module api.

Returns the thumbnail of a given image file.

  • return: - HTML img element or url
string GetThumbnail (string $path, [string $makeThumbnail = true], [string $urlOnly = false])
  • string $path: - the path of the file to create a thumbnail of (can be relative to the uploads dir or absolute)
  • string $makeThumbnail: - set to false if thumbnail may not be created if not exists
  • string $urlOnly: - set to true to get only the url to the thumbnail
GetVersion (line 42)
void GetVersion ()
HandleFileResizing (line 874)

Not part of the module api.

Adapted from TinyMCE filepicker.

void HandleFileResizing ( $source,  $output,  $newWidth,  $newHeight, [ $keepAspectRatio = true], [ $allowUpscaling = false], [ $quality = 100])
  • $source
  • $output
  • $newWidth
  • $newHeight
  • $keepAspectRatio
  • $allowUpscaling
  • $quality
HandlesEvents (line 109)
void HandlesEvents ()
HasAdmin (line 73)
void HasAdmin ()
HasCapability (line 157)
void HasCapability ( $capability, [ $params = array()])
  • $capability
  • $params
InstallPostMessage (line 97)
void InstallPostMessage ()
IsDirEmpty (line 848)

Not part of the module api.

Taken from TinyMCE Module (extracted from filepicker).

void IsDirEmpty ( $dir)
  • $dir
IsFalse (line 1089)

Not part of the module api.

Checks if a value is really meant to be "false". Can be usefull when checking smarty params for the value false

bool IsFalse (mixed $value)
  • mixed $value: - the value to check
IsPluginModule (line 69)
void IsPluginModule ()
IsTrue (line 1076)

Not part of the module api.

Checks if a value is really meant to be "true". Can be usefull when checking smarty params for the value true

bool IsTrue (mixed $value)
  • mixed $value: - the value to check
IsVarEmpty (line 1015)

Not part of the module api.

Checks if a var is empty. If $var is an array it recursivley checks all elements.

  • return: - true if empty, false if not
boolean IsVarEmpty ( &$var, [boolean $trim = true], [boolean $unsetEmptyIndexes = false], mixed $var)
  • mixed $var: - the var to check for empty value(s)
  • boolean $trim: - true to trim off spaces
  • boolean $unsetEmptyIndexes: - true to delete empty elements from array
  • &$var
MaximumCMSVersion (line 93)
void MaximumCMSVersion ()
MinimumCMSVersion (line 89)
void MinimumCMSVersion ()
SetParameters (line 149)
void SetParameters ()
SortFiles (line 863)

Not part of the module api.

Taken from TinyMCE filepicker.

void SortFiles ( $file1,  $file2)
  • $file1
  • $file2
UninstallPostMessage (line 101)
void UninstallPostMessage ()
UninstallPreMessage (line 105)
void UninstallPreMessage ()
VisibleToAdminUser (line 85)
void VisibleToAdminUser ()

Documentation generated on Sun, 05 Sep 2010 21:38:36 +0200 by phpDocumentor 1.4.0a2